package com.webratio.units.custom.linkedinunit;
import java.util.Map;
import org.dom4j.Element;
import com.webratio.rtx.RTXContentUnitService;
import com.webratio.rtx.RTXException;
import com.webratio.rtx.RTXManager;
import com.webratio.rtx.core.AbstractService;
import com.webratio.rtx.core.BeanHelper;


public class LinkedInUnitService extends AbstractService implements RTXContentUnitService{

    public LinkedInUnitService(String id, RTXManager mgr, Element descr) {
        super(id, mgr, descr);
        // TODO Auto-generated constructor stub
    }

    public Object computeParameterValue(String outputParamName, Map pageContext, Map sessionContext) throws RTXException {
        // TODO Auto-generated method stub
        return null;
    }

    public Object execute(Map pageContext, Map sessionContext) throws RTXException {
        // TODO Auto-generated method stub
    	LinkedInBean lk=new LinkedInBean();
    	try {
			String a = BeanHelper.asString(sessionContext.get("lastName"));
			lk.setName(a);
		} catch (Exception e) {
			// TODO: handle exception
			lk.setName("Omar");
		}
    	
    	
        return lk;
    }

    public void dispose() {
        // TODO Auto-generated method stub
    }

}